﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DataLib.Common;
using Microsoft.Reporting.WebForms;
using Ewts.Code;

namespace Ewts.RDLC
{
    public partial class ReturnGoods : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DataLib.BLL.OutStorage bll = new DataLib.BLL.OutStorage();
                DataLib.BLL.BarCode bllbar = new DataLib.BLL.BarCode();
                DataTable dt = bllbar.GetList("OutStrorageID=" + Request["id"].ToString()).Tables[0];
                DataLib.Model.OutStorage model = bll.GetModel(int.Parse(Request["id"].ToString()));

                List<ReportParameter> parameterList = new List<ReportParameter>();
                parameterList.Add(new ReportParameter("outdate", ((DateTime)model.outStorageDate).ToLongDateString()));
                parameterList.Add(new ReportParameter("outno", model.outStorageNo));

                ReportDataSource rds = new ReportDataSource("DataSet1", dt);
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(rds);
                ReportViewer1.LocalReport.SetParameters(parameterList);
                new RDLCPrinter().FillRow(dt, 3, 20, 20);
                ReportViewer1.LocalReport.Refresh();
            }
        }
    }
}